home *** CD-ROM | disk | FTP | other *** search
/ The Atari Compendium / The Atari Compendium (Toad Computers) (1994).iso / files / umich / falcon / programm.ing / nt_dsp1.lzh / NT_DSP1.MSA / FFT / DHIT1.ASM < prev    next >
Assembly Source File  |  1990-01-17  |  2KB  |  43 lines

  1. ;
  2. ; This program originally available on the Motorola DSP bulletin board.
  3. ; It is provided under a DISCLAMER OF WARRANTY available from
  4. ; Motorola DSP Operation, 6501 Wm. Cannon Drive W., Austin, Tx., 78735.
  5. ; Discrete Hilbert Transform in the frequency domain
  6. ; Last Update 18 Aug 88   Version 1.0
  7. ;
  8. dhit macro points,data
  9. dhit ident 1,0
  10.      opt nomd,mex
  11. ;
  12. ;Compute Hilbert transform in the frequency domain. This routine
  13. ;starts with "points" frequency domain data, located at "data", with real part
  14. ;in X-memory and imaginary part in Y-memory. The program gives the first 
  15. ;half of the frequency data a phase shift of -90 degrees ("positive 
  16. ;frequency" part) and the second half of the data a phase shift of +90
  17. ;degrees ("negative frequency" part). The magnitude of the complex
  18. ;data remains unchanged. The output data points are located at the same
  19. ;location.
  20. ;
  21.      move #data,r0           ;point to the positive-frequency data (real part)
  22.      move #-1,m0              ;linear addressing for 
  23.      move m0,m1               ;all pointers
  24.      move m0,m4
  25.      move m0,m5
  26.      move #data+points/2,r1  ;point to the negative-frequency data (real part)
  27.      move r0,r4               ;point to the positive-frequency data (imaginary part)
  28.      move r1,r5               ;point to the negative-frequency data (imaginary part)
  29.  
  30.      do #points/2,endloop      ;do for all frequency points
  31.  
  32.      move x:(r0),a  y:(r4),b            ;real -> a, imaginary -> b
  33.      neg a                              ;real part becomes - imaginary part
  34.      move      b,x:(r0)+ a,y:(r4)+      ;store real and imaginary parts
  35.      move      x:(r1),a  y:(r5),b       ;get negative-frequency data
  36.      neg  b                             ;imaginary part becomes - real part    
  37.      move      b,x:(r5)+ a,y:(r1)+      ;store negative-frequency data
  38. endloop
  39.      endm
  40.  
  41. ^Z